import request from '@/utils/request';

const handlerName = 'PublishFlow';
export async function query(params) {
    return request(`/api/${handlerName}/GetPage`, {
        method: 'POST',
        data: params,
    });
}

export async function addOrUpdate(params) {
    return request(`/api/AgentServer/AddOrUpdateAgentConfig`, {
        method: 'POST',
        data: { ...params },
    });
}
export async function update(params) {
    return request(`/api/${handlerName}/Update`, {
        method: 'Put',
        data: { ...params },
    });
}

export async function get(params) {
    return request(`/api/${handlerName}/GetById`, {
        method: 'Get',
        params
    });
}

export async function getCascader() {
    return request(`/api/AgentServer/GetCascader`, {
        method: 'Get'
    });
}


export async function startPublish(params) {
    return request(`/api/PublishFlow/StartPublish`, {
        method: 'POST',
        data: { ...params },
    });
}
export async function cancelPublish(params) {
    return request(`/api/PublishFlow/CancelPublish`, {
        method: 'POST',
        data: { ...params },
    });
}

export async function restorePublish(params) {
    return request(`/api/PublishFlow/RestorePublish`, {
        method: 'POST',
        data: { ...params },
    });
}

export async function completePublish(params) {
    return request(`/api/PublishFlow/CompletePublish`, {
        method: 'POST',
        data: { ...params },
    });
}
